package com.iamteer.c_session;

import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
/**
 * 监听此对象绑定到Session 上的过程，需要实现 Session 特定接口
 * @author Chuck
 *
 */
public class Admin implements HttpSessionBindingListener {

	private int id;
	private String name;
	
	public Admin() {
		super();
	}

	public Admin(int id, String name) {
		super();
		this.id = id;
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public void valueBound(HttpSessionBindingEvent arg0) {
		// TODO Auto-generated method stub
		System.out.println("Admin 对象已经放入session ");
	}

	@Override
	public void valueUnbound(HttpSessionBindingEvent arg0) {
		// TODO Auto-generated method stub
		System.out.println("Admin 对象从 Session 中移除");
	}
		
}
